IF EXISTS (SELECT * FROM sysobjects WHERE type = 'FN' AND name = 'FN_CleanMoneyValue')
	BEGIN
		DROP  Function FN_CleanMoneyValue
	END
GO

CREATE FUNCTION dbo.FN_CleanMoneyValue(@moneyValue money)
RETURNS money
AS

BEGIN
	IF @moneyValue IS NULL
		RETURN 0
		
	RETURN @moneyValue
END 